Problem: Dave has $d$ pieces of candy and Ramon has $r$ pieces. Dave gives Ramon $\frac{1}{3}$ of his candy. They then each have 20 pieces of candy. What is the value of $d$?
Solution: After Dave gives away $\frac{1}{3}$ of his candy, he has $\frac{2}{3}$ of it left. If $20$ pieces is $\frac{2}{3}$ of $d$, then we have $\frac{2}{3}d=20$. Multiplying both sides by $\frac{3}{2}$, we find that $d=\boxed{30}$.